package com.alingrad.android.froyoengine.graphics;

import com.alingrad.android.froyoengine.util.ObjectPool;

public class RenderNodePool extends ObjectPool<RenderNode> {
	private static final int DEFAULT_CAPACITY = 512;
	
	public RenderNodePool() {
		super(DEFAULT_CAPACITY);
	}
	
	public RenderNodePool(int capacity) {
		super(capacity);
	}
	
	public RenderNode allocate(Renderable task, float x, float y, float z, float scaleX, float scaleY, float rotation) {
		RenderNode node = allocate();
		node.mX = x;
		node.mY = y;
		node.mZ = z;
		node.mScaleX = scaleX;
		node.mScaleY = scaleY;
		node.mRotation = rotation;
		node.mTask = task;
		return node;
	}
	
	@Override
	public RenderNode constructItem(int index) {
		return new RenderNode();
	}
	

}
